﻿/**
* Vista asociada al contenido 
* del tab de la funcionalidad NUEVO AVANCE
* en el aplicativo.
*/
Ext.define("entgpv11.view.details.UpdateInfo", {
    extend: "Ext.form.Panel",
    requires: "Ext.form.FieldSet",
    alias: "widget.updateinfo",
    config:
    {
        fullscreen: true,
        flex: 1,
        scrollable: 'vertical',
        data: null
    },
    initialize: function () {

        this.callParent(arguments);
        var idFormHidden = {
            xtype: 'textfield',
            name: 'id',
            hidden: true,
            value: 0
        };
        var note = {
            xtype: 'textareafield',
            name: 'sObs',
            label: 'Detalle',
            minHeight: '20%'
           
        };
        var valor = {
            xtype: 'spinnerfield',
            name: 'iAvance',
            minHeight: '70%',
            minValue: 0,
            maxValue: 100,
            increment: 1,
            label: 'Avance',
            readOnly: true
        };
        this.add([
          {
              xtype: 'toolbar',
              docked: 'top',
              ui: 'sub',
              title: 'Nuevo Avance',
              items: [

                          {
                              xtype: "button",
                              iconMask: true,
                              pressed: true,
                              iconCls: 'refresh',
                              scope: this,
                              handler: this.onResetButtonTap
                          },
                           {
                               xtype: "button",
                               iconMask: true,
                               pressed: true,
                               iconCls: 'save',
                               ui: 'action',
                               scope: this,
                               handler: this.onSaveButtonTap
                           },
                          { xtype: 'spacer' }

                   ]
          },
		    {
		        xtype: "fieldset",
		        defaults: {
		            labelWidth: '35%'
		        },
		        items: [
                    idFormHidden,valor, note
                ]
		    },
            { xtype: 'spacer' }

        ]);
    },
    onSaveButtonTap: function () {

        this.fireEvent("saveButtonTapCommand", this);
    },
    onResetButtonTap: function () {

        this.fireEvent("resetButtonTapCommand", this);
    },
    setDataId: function (id) {
        var objId = this.down("textfield");
        objId.setValue(id);
    }

});

